chrome.webRequest.onHeadersReceived.addListener(
    (details) => {
        const contentTypeHeader = details.responseHeaders.find(
            header => header.name.toLowerCase() === 'content-type'
        );

        if (contentTypeHeader && contentTypeHeader.value.includes('application/json')) {
            chrome.storage.session.set({
                [details.url]: true
            });
        }

        return { responseHeaders: details.responseHeaders };
    },
    { urls: ["<all_urls>"] },
    ["responseHeaders"]
    // ["responseHeaders", "blocking"]
);